﻿var fs = require("fs");
var http = require("http");

server = http.createServer(function (request, response) {
    console.log("Request received");
    fs.readFile("index.html", function (err, data) {
        response.writeHead(200, { "Content-Type": "text/html" });
        response.write(data);
        response.end();
    });
});
    server.listen(8000);
    console.log("Server has started");


var everyone = require("now").initialize(server);

everyone.now.distributeMessage = function (msg) {
    everyone.now.receiveMessage(this.now.name, msg);
};   

